import * as React from "react";
const { useState } = React;

const App = () => {
  const [count, setCount] = useState(0);
  return (
    <div>
      <h1 onClick={() => setCount(prev => prev + 1)}>{count}</h1>
    </div>
  );
};

/**
 在legacyRenderSubTreeIntoContainer中，创建完成根fiber之后，就会开始启动更新
 render模式：
    第一阶段：
    updateContainer -> scheduleUpdateOnFiber -> (ensureRootIsScheduled / performSyncWorkOnRoot)
    -> (scheduleSyncCallback / scheduleCallback) -> performSyncWorkOnRoot 

    第二阶段：
    performSyncWorkOnRoot -> renderRootSync -> workLoopSync -> performUnitOfWork


 concurrent模式：
    updateContainer -> scheduleUpdateOnFiber -> ensureRootIsScheduled 
    -> scheduleCallback -> performConcurrentWorkOnRoot 
    -> renderRootConcurrent -> workLoopConcurrent -> performUnitOfWork

 上面两个模式最终会在 performUnitOfWork 汇合
 */



export default App;
